// ContainerView.cpp : implementation file
// Download by http://www.NewXing.com

#include "stdafx.h"
#include "LeoBlock2004.h"
#include "ContainerView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CContainerView

IMPLEMENT_DYNCREATE(CContainerView, CView)

CContainerView::CContainerView()
{
}

CContainerView::~CContainerView()
{
}


BEGIN_MESSAGE_MAP(CContainerView, CView)
	//{{AFX_MSG_MAP(CContainerView)
	ON_WM_CREATE()
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CContainerView drawing

void CContainerView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}

/////////////////////////////////////////////////////////////////////////////
// CContainerView diagnostics

#ifdef _DEBUG
void CContainerView::AssertValid() const
{
	CView::AssertValid();
}

void CContainerView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CContainerView message handlers

int CContainerView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	m_plitterWnd.CreateStatic(this,1,2);

	//Context
	CCreateContext *pContext=(CCreateContext*)lpCreateStruct->lpCreateParams;

	if(!m_plitterWnd.CreateView(0, 0, RUNTIME_CLASS(COutbarView), CSize(80, 0), pContext))
		return -1;

	//Create CTestDownView
	if(!m_plitterWnd.CreateView(0,1,RUNTIME_CLASS(CListViewInfo),CSize(0,0),pContext))
		return -1;

	

	return 0;
}

void CContainerView::OnSize(UINT nType, int cx, int cy) 
{
	CView::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
	m_plitterWnd.MoveWindow(-2,-2,cx+4,cy+4);

	
}

COutbarView*  CContainerView::GetOutbarView()
{
	return (COutbarView*)m_plitterWnd.GetPane(0,0);
}

CListViewInfo* CContainerView::GetListViewInfo()
{
	return (CListViewInfo*)m_plitterWnd.GetPane(0,1);
}

void CContainerView::OnInitialUpdate() 
{
	CView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	GetOutbarView()->SetCListViewInfo(GetListViewInfo());
}
